package com.mercury.pattern._15_iterator;

import java.util.Iterator;

/**
 *
 */
public class Client {
    public static void main(String[] args) {
        Department [] depts = new Department[2];
        depts[0] = new Department("计算机科学与技术","123");
        depts[1] = new Department("软件工程","123");

        ComputerCollege computerCollege = new ComputerCollege(depts);
        Iterator iterator = computerCollege.createIterator();
        while(iterator.hasNext()){
            Department department = (Department) iterator.next();
            System.out.println(department.getName());
        }
    }
}